* {
    margin: 0;
    padding: 0;
}
body {
    height: 100vh;
    background-color: #000;
}

.box {
    width: 800px;
    height: 100%;
    border: 1px solid white;
    margin: 0 auto;
    position: relative;
}
// 充电百分比
.number {
    color: #fff;
    position: absolute;
    z-index: 1;
    width: 200px;
    height: 200px;
    line-height: 200px;
    text-align: center;
    font-size: 30px;
    left: 50%;
    top: 25%;
    margin-left: -100px;
}
.contrast {
    width: 100%;
    height: 100%;
    background-color: #000;
    position: relative;
    border: 1px solid red;
    filter: contrast(15);
    animation: hueRotate 2.5s linear infinite;
}
.circle {
    width: 300px;
    height: 300px;
    position: absolute;
    top: 20%;
    left: 50%;
    margin-left: -150px;
    // 设置模糊度，配合上面的contrast可以产生粘性效果
    filter: blur(8px);
    animation: circleRotate 5s linear infinite;
    // 外围
    &::before {
        content: '';
        width: 200px;
        height: 200px;
        background-color: cyan;
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        border-radius: 42% 38% 63% 49%/45%;
    }
    // 中心圆
    &::after {
        content: '';
        width: 178px;
        height: 178px;
        background-color: #000;
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        border-radius: 50%;
    }
}

.bubble-home {
    width: 100px;
    height: 40px;
    background-color: cyan;
    position: absolute;
    left: 50%;
    bottom: 0;
    margin-left: -50px;
    border-radius: 100px 100px 0 0;
    filter: blur(8px);
}
.bubble {
    width: 20px;
    height: 20px;
    background-color: cyan;
    border-radius: 100%;
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    z-index: 2;
    filter: blur(5px);
    animation: bubbleUp 5s ease-in-out infinite;
    @for $i from 1 to 6 {
        &:nth-child(#{$i}) {
            // width: random() * 10px + 17px;
            // height: random() * 10px + 17px;
            // left: random() * 10% + 45%;
            animation-duration: 5s;
            animation-delay: $i * 1s;
        }
    }
}

@keyframes hueRotate {
    0% {
        filter: contrast(15) hue-rotate(0);
    }
    100% {
        filter: contrast(15) hue-rotate(360deg);
    }
}
@keyframes circleRotate {
    0% {
        transform: rotate(0);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes bubbleUp {
    0% {
        bottom: 0;
    }
    80% {
        opacity: 1;
    }
    100% {
        bottom: calc(80% - 260px);
        opacity: 0;
    }
}
